package cn.zf.spring5.bean;
//员工类
public class Emp {
    private String ename;
    private String gender;
    //用对象的形式表示员工属于某个部门
    private Dept dept;



    /**
     * 级联赋值 需要有get方法
     * @return
     */
    public Dept getDept() {
        return dept;
    }

    public void setDept(Dept dept) {
        this.dept = dept;
    }

    public void setEname(String ename) {
        this.ename = ename;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }
    public void add(){
        System.out.println("Emp{" +
                "ename='" + ename + '\'' +
                ", gender='" + gender + '\'' +
                ", dept=" + dept +
                '}');
    }

}
